
<!DOCTYPE html>
<html style="overflow-x: hidden; overflow-y: scroll;" xmlns="http://www.w3.org/1999/xhtml">
    <head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="Pragma" content="no-cache"/>
		<meta http-equiv="Cache-Control" content="no-cache"/>
		<meta http-equiv="Expires" content="0"/>
		<meta content="width=device-width; initial-scale=1.0,maximum-scale=1.0,user-scalable=no;" name="viewport" />	
		<meta content="telephone=no" name="format-detection" />	
		<meta name="keywords" content="{obj('base/Base')->SEO('index_keywords')}" />
        <meta name="description" content="{obj('base/Base')->SEO('index_dec')}" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-touch-fullscreen" content="YES"/>
		<title>{obj('base/Base')->SEO('index_title')}</title>
		<link media="all" rel="stylesheet" type="text/css" href="{__PUBLIC__}m/css/mstyle_201710191953.css" />
		<link media="all" rel="stylesheet" type="text/css" href="{__PUBLIC__}m/css/mdetailfix_201710191954.css" />

		
	</head>
	<body>
		<div id="wrapper">
			<div id="header">
				<img class="headerpic" src="{__PUBLIC__}m/images/header.png?v=06012111" />
				<img class="leftslogan" src="{__PUBLIC__}m/images/leftslogan.png?v=06012111" />
				<img class="righttopc" id="imgtopc" src="{__PUBLIC__}m/images/topc.png?v=06012111" />
			</div>
			          			
{if $dev=="android" || $dev=="other"}
<div class="bannerarea">
	
		<img class="bannerimg" src="{__PUBLIC__}m/images/androidbanner.png"/>
	
</div>   
{/if} 		
{if $dev=="ios"}
<div class="bannerarea">
	
		<img class="bannerimg" src="{__PUBLIC__}m/images/iosbanner.png"/>
	
</div>   
{/if} 			
	
			<div id="funcarea">
				<span class="channelentrance todeals currenttab"><span class="entranceword">实时折扣</span></span>
				<span class="channelentrance torank othertab"><span class="entranceword">风云榜</span></span>
				<span class="channelentrance tocheaps othertab"><span class="entranceword">优惠券</span></span>
				<span class="channelentrance searchres currenttab" style="display:none"><span class="entranceword">搜索结果</span></span>
				<img class="refreshpic" src="{__PUBLIC__}m/images/refresh.png" />
				<img class="search" src="{__PUBLIC__}m/images/search.png" />
			</div>
			<div id="funcareafix" style="display:none">
				<span class="channelentrance todeals currenttab"><span class="entranceword">实时折扣</span></span>
				<span class="channelentrance torank othertab"><span class="entranceword">风云榜</span></span>
				<span class="channelentrance tocheaps othertab"><span class="entranceword">优惠券</span></span>
				<span class="channelentrance searchres currenttab" style="display:none"><span class="entranceword">搜索结果</span></span>
				<img class="refreshpic" src="{__PUBLIC__}m/images/refresh.png" />
				<img class="search" src="{__PUBLIC__}m/images/search.png" />
			</div>
            <div id="main">	
				<div id="listarea"></div>
				<div class="middleline loadmorearea">
					<div id="loadmore" class="loadmore" style="display:none"><span class="loadmoreword">加载更多30条...</span></div>
					<div id="loading" class="loading"><img class="loadingicon" src="{__PUBLIC__}m/images/loadingicon.gif"><span class="loadingmoreword">加载中，请稍候...</span></div>
				</div>
			</div>
			<div id="footer"></div>
			<div class="fixlayer">
				<div class="searcharea" style="display:none">
					<div class="searchareahead">
						<div class="searchareaheadword">搜索本站折扣</div>
						<img class="searchareaheadclose" id="searchareaheadclose"src="{__PUBLIC__}m/images/closeicon.png?v=201402101903">
					</div>
					<input class="searchfixfield" onkeydown="clickButton()" type="text" id="searchfixfield"/>
					<img class="searchfixbtn" id="searchfixbtn"src="{__PUBLIC__}m/images/searchicon.png?v=201402101903">
				</div>
			</div>
		</div>
		<div class="translucent" style="display:none"></div>

	
    <script src="{__PUBLIC__}web/js/jquery-1.9.1.min.js"></script>
	<script type='text/javascript'>

	var currentPage=1;
	var timeStr=new Date().getTime();
	{if ACTION_NAME=='search'}
		var loadStr='index.php?r=index/m/getindexdata&action=search&key=<?=$_GET['key']?>&v='+timeStr+'&p=';
	{else}
	var loadStr='index.php?r=index/m/getindexdata&v='+timeStr+'&p=';
	{/if}
	
	var curQuery='';
	var curChannel={if ACTION_NAME=='search'}4{else}1{/if};
	
	$(function(){
		if(curQuery!='')
		{
			//curChannel=4;
			$("#loadmore").show();
			//loadStr='searchosdata.php?q='+curQuery+'&v='+timeStr+'&p=';
			//alert(curQuery);
			
			initstyle();
		}
		initchannel();
		
		
		function initstyle()
		{
			$("div.more").click(function(){
				var thisobj=$(this);
				var currentid=thisobj.find("span.idnum").text();
				var urltoload="index.php?r=index/m/loadview&id="+currentid;				
				thisobj.parent().parent().find("a.thumbnail").hide();
				thisobj.parent().find("div.abstract").hide();
				thisobj.parent().find("a.buy").hide();
				thisobj.parent().find("div.mallname").hide();
				thisobj.parent().find("div.info").hide();
				thisobj.hide();
				thisobj.parent().parent().find("div.waitingload").show();
				thisobj.parent().parent().find("div.fullabstract").load(urltoload,function(){
					thisobj.parent().parent().find("div.fullabstract").show();
					thisobj.parent().parent().find("div.waitingload").hide();
					xlog(currentid,'mmore');
				});
		　　});

			$(".clicktounfold").click(function(){
				var thisobj=$(this);
				var currentid=thisobj.find("span.idnum").text();
				var urltoload="index.php?r=index/m/loadview&id="+currentid;
				thisobj.parent().parent().find("div.waitingload").show();
				thisobj.parent().parent().find("div.rankinfoandabstract").hide();
				thisobj.parent().parent().find("a.rankthumbnail").hide();
				thisobj.parent().find("div.rankmore").hide();
				thisobj.parent().parent().find("div.fullabstract").load(urltoload,function(){
					thisobj.parent().parent().find("div.fullabstract").show();
					thisobj.parent().parent().find("div.searchtitle").show();
					thisobj.parent().parent().find("div.waitingload").hide();
				});
		　　});

			$(".rankmoreclick").click(function(){
				var thisobj=$(this);
				var currentid=thisobj.find("span.idnum").text();
				var urltoload="index.php?r=index/m/loadview&id="+currentid;
				thisobj.parent().parent().find("div.waitingload").show();
				thisobj.parent().parent().find("a.rankthumbnail").hide();
				thisobj.parent().parent().find("div.fullabstract").load(urltoload,function(){
					thisobj.parent().parent().find("div.fullabstract").show();
					thisobj.parent().parent().find("div.waitingload").hide();
					thisobj.hide();
				});
		　　});

			$("a.pandvrank").click(function(){
				var curhref=$(this).attr("lazyhref");
				$("#funcareafix").hide();
				$("#listarea").hide();
				$("#loadmore").hide();
				$("#loading").show();
				$.get(curhref, function(data){
					$("#listarea").html(data);
					$("#listarea").show();
					$("#loading").hide();
					$('body,html').animate({scrollTop:0},0);
					initstyle();
				});
		　　});

			$("#searchfixbtn").click(function(){
				sbscr();
			});

			$(".search").click(function(){
				$(".translucent").show();
				$(".searcharea").show();
				$("#searchfixfield").focus();
			});

			$("#searchareaheadclose").click(function(){
				$(".translucent").hide();
				$(".searcharea").hide();
			});

			

			if(curChannel==1)
			{
				$("#loadmore").show();
				$(".searchres").hide();
				$(".refreshpic").show();
				$(".loadmorearea").show();
				$(".todeals").removeClass("othertab");
				$(".todeals").addClass("currenttab");
				$(".torank").removeClass("currenttab");
				$(".torank").addClass("othertab");
				$(".tocheaps").removeClass("currenttab");
				$(".tocheaps").addClass("othertab");
			}
			else if(curChannel==2)
			{
				$("#loadmore").hide();
				$(".searchres").hide();
				$(".refreshpic").hide();
				$(".todeals").removeClass("currenttab");
				$(".todeals").addClass("othertab");
				$(".torank").removeClass("othertab");
				$(".torank").addClass("currenttab");
				$(".tocheaps").removeClass("currenttab");
				$(".tocheaps").addClass("othertab");
			}
			else if(curChannel==3)
			{
				$("#loadmore").show();
				$(".searchres").hide();
				$(".refreshpic").show();
				$(".loadmorearea").show();
				$(".todeals").removeClass("currenttab");
				$(".todeals").addClass("othertab");
				$(".torank").removeClass("currenttab");
				$(".torank").addClass("othertab");
				$(".tocheaps").removeClass("othertab");
				$(".tocheaps").addClass("currenttab");
			}
			else if(curChannel==4)
			{
				$(".searchres").show();
				$(".refreshpic").hide();
				$(".todeals").removeClass("currenttab");
				$(".todeals").addClass("othertab");
				$(".torank").removeClass("currenttab");
				$(".torank").addClass("othertab");
				$(".tocheaps").removeClass("currenttab");
				$(".tocheaps").addClass("othertab");
				
			}
		}

		function initchannel()
		{
			$.get(loadStr+currentPage, function(data){
				$("#listarea").append(data);
				$("#loading").hide();
				$("#loadmore").show();
				initstyle();
				$('body,html').animate({scrollTop:0},0);
				currentPage++;
			});
		}

		function switchchannel()
		{
			$("#funcareafix").hide();
			$("#listarea").hide();
			$("#loadmore").hide();
			$("#loading").show();
			$.get(loadStr+"1", function(data){
				$("#listarea").html(data);
				$("#listarea").show();
				$("#loading").hide();
				$("#loadmore").show();
				$('body,html').animate({scrollTop:0},0);
				currentPage=2;
				initstyle();
			});
		}

		$("#loadmore").click(function(){
			$("#loadmore").hide();
			$("#loading").show();
			$.get(loadStr+currentPage, function(data){
				$("#listarea").append(data);
				$("#loading").hide();
				$("#loadmore").show();
				initstyle();
				currentPage++;
				console.log(currentPage);
			});
				
	　　});
		
		$(".refreshpic").click(function(){
			$("#funcareafix").hide();
			$("#listarea").hide();
			$("#loadmore").hide();
			$("#loading").show();
			$.get(loadStr+"1", function(data){
				$("#listarea").html(data);
				$("#listarea").show();
				$("#loading").hide();
				$("#loadmore").show();
				$('body,html').animate({scrollTop:0},0);
				currentPage=2;
				initstyle();
			});
	　　});

		$("#add2dest").click(function(){
			$.get("../setcookie.php?name=ifTipClicked&value=yes&last=2592000", function(data){
				$("#add2dest").hide();
			});
	　　});

		$("#imgtopc").click(function(){
			window.location.href='{obj('base/Base')->SiteConfig('hosturl')}/m-gift.html';
	　　});

		$(".todeals").click(function(){
			loadStr ='index.php?r=index/m/getindexdata&v='+timeStr+'&p=';
			curChannel=1;
			switchchannel();
	　　});

		$(".torank").click(function(){
			loadStr ='index.php?r=index/m/rank&v'+timeStr+'&type=hot&p=';
			curChannel=2;
			switchchannel();
	　　});

		$(".tocheaps").click(function(){
			loadStr ='index.php?r=index/m/cheaps&v='+timeStr+'&p=';
			curChannel=3;
			switchchannel();
	　　});

		$(window).scroll(function(){
			if ($(window).scrollTop()>60){
				$("#funcareafix").show(20);
			}
			else
			{
				$("#funcareafix").hide(20);
			}
		});
	
	});
	
	function xlog(id,pos)
	{
		//$.get("../log.php?id="+id+"&pos="+pos);
		var urlwithpara="index.php?r=index/index/log&id="+id+"&pos="+pos;
		$.ajax({  
			type: "get",  
			async: false,
			url: urlwithpara,  
			dataType: "jsonp",  
			success: function(data){
			//alert(data.data);  
			},  
			error: function(){  
			//alert('fail');  
			}  
		});
	}

	function sbscr()
	{
		var query=document.getElementById("searchfixfield").value;
		$(".searcharea").hide();
		$(".translucent").hide();
		$("#funcareafix").hide();
		if(query!="")
		{
			var reg = /^(\w|\s|[\u4E00-\u9FA5])*$/;
			if(arr=query.match(reg))
			{
				window.location.href='{url($route='index/m/search/key=<key>', $params=array('key'=>"'+query+'"))}';
			}
			else
			{
				$("#searchtip").html("只可查询中英文或数字");
			}
			
		}
	}

	function clickButton() 
	{     
		if (event.keyCode == 13) 
		{      
			sbscr();
		}
	}
	
	
	</script>
	 

{base64_decode(obj('base/Base')->SiteConfig('tongji'))}
    </body>
</html>


